/*
 * Copyright 2010 Christoph Widulle (christoph.widulle@googlemail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */


package com.android1.amarena2d.commons;

import com.android1.amarena2d.annotations.Draft;
import com.android1.amarena2d.annotations.Incomplete;
import com.android1.amarena2d.engine.LifecycleListener;
import com.android1.amarena2d.nodes.LifecycleObject;

@Incomplete
@Draft
public interface Functions {

    public static interface Lifecycle {

        public static final Function<LifecycleObject, Void> Init = new Function<LifecycleObject, Void>() {
            @Override
            public Void exec(LifecycleObject input) {
                input.init();
                return null;
            }
        };

        public static final Function<LifecycleObject, Void> Dispose = new Function<LifecycleObject, Void>() {
            @Override
            public Void exec(LifecycleObject input) {
                input.dispose();
                return null;
            }
        };

        public static final Function<LifecycleObject, Void> Enter = new Function<LifecycleObject, Void>() {
            @Override
            public Void exec(LifecycleObject input) {
                input.enter();
                return null;
            }
        };

        public static final Function<LifecycleObject, Void> Exit = new Function<LifecycleObject, Void>() {
            @Override
            public Void exec(LifecycleObject input) {
                input.exit();
                return null;
            }
        };


        public static interface Listener {

            public static final Function<LifecycleListener, Void> Init = new Function<LifecycleListener, Void>() {
                @Override
                public Void exec(LifecycleListener input) {
                    input.onInit();
                    return null;
                }
            };

            public static final Function<LifecycleListener, Void> Dispose = new Function<LifecycleListener, Void>() {
                @Override
                public Void exec(LifecycleListener input) {
                    input.onDispose();
                    return null;
                }
            };

            public static final Function<LifecycleListener, Void> Enter = new Function<LifecycleListener, Void>() {
                @Override
                public Void exec(LifecycleListener input) {
                    input.onEnter();
                    return null;
                }
            };

            public static final Function<LifecycleListener, Void> Exit = new Function<LifecycleListener, Void>() {
                @Override
                public Void exec(LifecycleListener input) {
                    input.onExit();
                    return null;
                }
            };
        }
    }


}